package io.github.harmonly.skyblock.manager;

import io.github.harmonly.skyblock.SkyBlock;
import io.github.harmonly.skyblock.listener.BlockBreakListener;
import io.github.harmonly.skyblock.listener.PlayerListener;
import org.bukkit.Bukkit;
import org.bukkit.event.Listener;

public class ListenerManager {

    // 私有构造方法，防止实例化
    private ListenerManager() {
    }

    /**
     * 注册所有的监听器
     */
    public static void registerListeners() {
        registerListener(new BlockBreakListener());
        registerListener(new PlayerListener());
    }

    /**
     * 注册单个监听器
     *
     * @param listener 监听器实例
     */
    public static void registerListener(Listener listener) {
        Bukkit.getPluginManager().registerEvents(listener, SkyBlock.getInstance());
    }
}
